import Vue from 'vue'
import byStore from 'biyi-store'
import iView from 'view-design'
import ElementUI from 'element-ui'
import 'view-design/dist/styles/iview.css'
import App from './app.vue'
import util from './libs/util'
import router from './router/router'
import store from './store/store'
import { ButtonLimited, dataTag } from './views/admin'
import directive from './directive' // directive
import Treeselect from '@riophae/vue-treeselect'
import UserSelect from '@/views/components/user/index.vue'

// bpmn
import axios from 'axios'
import './views/workflow/package/theme/element-variables.scss'
import { vuePlugin } from './views/workflow/package/highlight'
import 'highlight.js/styles/atom-one-dark-reasonable.css'
import MyPD from './views/workflow/package/index.js'
import 'bpmn-js/dist/assets/diagram-js.css'
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css'
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css'
// vform 依赖
import 'babel-polyfill'
import './views/lowcode/utils/debug-console'
import './views/lowcode/utils/directive'
import './views/lowcode/icons'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss'
import '@/views/lowcode/icons/iconfont/iconfont.css'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import VFormDesigner from '@/views/lowcode/components/form-designer/index'
import { loadExtension } from './views/lowcode/extension/extension-loader'
// import { Tree } from 'element-ui'
import { iconList } from './libs/icon.js'
import moment from 'moment'
Vue.prototype.$axios = axios
Vue.use(vuePlugin)
Vue.use(MyPD)

loadExtension() // 引入VForm库
Vue.prototype.$moment = moment
Vue.config.productionTip = false
Vue.prototype.$util = util
Vue.prototype.$http = util.http
Vue.prototype.$iconList = iconList
Vue.prototype.$bus = new Vue()
Vue.use(byStore)
// Vue.use(Tree)
Vue.use(ElementUI)
Vue.use(directive)
Vue.use(iView)

Vue.component('Button', ButtonLimited)
Vue.component('dataTag', dataTag)
Vue.component('VFormDesigner', VFormDesigner)
Vue.component('Treeselect', Treeselect)
Vue.component('UserSelect', UserSelect)

const vm = new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

export default vm
